home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
ezy_comm
/
ezy1023.zip
/
EKIT102.ZIP
/
EZYMSG.DOC
< prev
next >
Wrap
Text File
|
1992-10-24
|
16KB
|
442 lines
Ezycom
Message Base Structures
Specifications V1.02
Copyright (C) Peter Davies 1992.
Table of Contents
1.0 Legal Aspects
2.0 Specifications
2.1 Pascal Structures
2.2 C Structures
3.0 Message Base in Detail
3.1 Overview
3.2 Message Header
3.3 Message Text
3.4 MSGFAST.BBS (Fast Mail Check Index)
3.5 MSGCOUNT.BBS (Message Area Number of Messages)
3.6 MSGEXPORT.BBS (Message Area requires Scan)
3.7 MSGREPLY.BBS (Message Area requires Reply Chaining)
3.8 Pascal Strings
4.0 Conclusion
1.0 Legal Aspects
These structures and specifications remain the
copyrighted works of Peter Davies. They are freely
available for use by anyone, but must be used in an
unchanged format. Also, to use these structures, you must
completly implement them, to keep direct compatibility with
the message base structures.
2.0 Specifications
2.1 Pascal Structures
type
netrecord = record
zone,
net,
node,
point : word
end;
userstring = string[35];
(*
**********************************************************
Filename: <msgpath>\AREA<<area-1>/4+1>\MSGH<area>.BBS
Description: Used by Ezycom to store message header
**********************************************************
*)
msghdrrecord = record
prevreply,
nextreply : word;
(* 0 = No Reply Chain *)
startposition,
(* Physical Start Position in MSGTxxx.BBS *)
messagelength : longint;
(* Message Length including Null Terminator *)
destnet,
orignet : netrecord;
cost : word;
msgattr,
(* Bit 0 : Deleted
1 : Netmail pending export
2 : [Reserved]
3 : Private
4 : Received
5 : Echomail pending export
6 : Locally generated msg
7 : Do not kill message *)
netattr,
(* Bit 0 : Kill/sent
1 : Sent
2 : File Attach
3 : Crash
4 : File Req
5 : Request Receipt
6 : Audit Request
7 : Is a Return Receipt *)
extattr : byte;
(* Bit 0-7 [Reserved] *)
posttimedate : longint;
(* DOS Format Packed DateTime *)
recvtimedate : longint;
(* DOS Format Packed DateTime *)
whoto,
whofrom : userstring;
subject : string[72];
end;
(*
**********************************************************
Filename: <msgpath>\AREA<<area-1>/4+1>\MSGT<area>.BBS
Description: Used by Ezycom to store message text
**********************************************************
*)
(* Message Text
Each text part of the message starts at
'startposition', and continues on until a NULL terminator is
found, or end of file is reached (shouldn't happen, but just
in case). The message text length is limited by Turbo
Pascal to 16 Meg in size. Each message is contained of
plain text, with 0x08D terminators for wrapped lines or 0x0D
terminators for hard carriage returns. No line of text
should exceed 79 characters excluding the terminator *)
(*
**********************************************************
Filename: <msgpath>MSGFAST.BBS
Description: Used by Ezycom for mail checks
**********************************************************
*)
msgfastrecord = record
whoto : longint;
(* standard 32 Bit CRC on whoto in MSGH???.BBS
Username is CRCd in UPPERCASE, and does not
include null terminator or length byte *)
msgboard : word;
msgnumber : word;
end;
(*
**********************************************************
Filename: <msgpath>MSGEXPRT.BBS
Description: Used by Ezycom to tell EzyNet/EzyMail whether
an area needs scanning or not
**********************************************************
*)
needscanrecord = array[1..maxmess] of boolean;
(*
**********************************************************
Filename: <msgpath>MSGREPLY.BBS
Description: Used by MsgComp to tell it which conference(s)
need reply chain linking
**********************************************************
*)
needreplytype = array[1..maxmess] of boolean;
(*
**********************************************************
Filename: <msgpath>MSGCOUNT.BBS
Description: Used by Ezycom and Utilities for message area
counting. You must lock EACH two bytes, then
update/read it, then unlock it to update a
message area count. Reading the number of
records of MSGHxxx.BBS gives the same effect
as reading the conferences count.
**********************************************************
*)
msgareacounttype = array[1..maxmess] of word;
3.0 Message Base in Detail
3.1 Overview
Ezycom message base is stored in paths off of the
message base directory. These paths contain 100 message
areas. They are named AREA1, AREA2 and so forth. AREA1
will contain message areas 1 through to 100. AREA2 will
contain message areas 101 through to 200 and so on.
For each of the message areas, two files exist.
MSGHxxx.BBS and MSGTxxx.BBS. The MSGHxxx.BBS is the header
file for the message area and the MSGTxxx.BBS is the text
file for the message area. The xxx is the message area
number "0" padded. So, message area 1 would be MSGT001.BBS
for example. Message areas 1000 and above use a forth
digit, and are named as MSGHxxxx.BBS and MSGTxxxx.BBS. An
example for message area 1010 would be MSGH1010.BBS.
3.2 Message Header
This file contains the "Header" information of each
message. In contains information such as who the message is
from, to, subject, reply chain information, and other
attributes. When opening up this message area, it should
ALWAYS be opened in a DENYNONE mode. I suggest when opening
it, you also open it in READWRITE mode, in case you need to
update any message attributes. There is a possibility that
the message area doesn't exist, so make sure you check for
it. Also, the message area may be 0 in length, so make sure
you check for that.
The reply chains (prevreply, nextreply) point to the
previous message and next message in the reply chains
respectively. A value of 0, means that there is no
previous/next reply chain respectively. A value of 1, would
mean the message at record 0. A value of 2, would mean the
message at record 1, and so on.
StartPosition is the location in MSGTxxx.BBS where the
text starts for this message. MessageLength is the length
in bytes of the message text including the null terminator
(explained later).
OrigNet and DestNet contain fidonet addresses of who
the message came from, and who it is to for netmail message
areas. OrigNet is also set for who the message came from,
on importing EchoMail with a valid MSGID kludge line. These
should be zeroed out when not in use. Cost is for netmail
areas, and specifically holds the cost of a message.
The MsgAttr contains certain attributes of each
message. Most are self explanatory, but a few details must
be explained. Any message written locally, must have a
Local Bit Set. Any message written in an echomail message
area, must have Echomail pending Export set, to tell the
echomail scanner that the message needs exporting. Any
message written in a netmail message area, must have Netmail
pending Export set, to tell the netmail scanner that the
message needs exporting.
The NetAttr simply holds netmail attributes, although
some are used (receipts) for local message areas in Ezycom.
The ExtAttr is not currently used, but you should not
take the assumption that it is free for you to use, or else
your program might not be compatiable in later versions.
Posttimedate is a DOS packed time and date of the
message. DOS packed, is what MSDOS uses to store the date
of each file. This was used to keep the message base as
small as possible. Recvtimedate is simply the time and date
when the message was received. The value is undefined if
the message has not been received. This variable should be
used in conjunction with the Received Bit in MsgAttr.
WhoTo, WhoFrom and Subject are simply who the message
is to, who the message is from and the subject.
3.3 Message Text
This file contains the textual part of the message.
When reading the MSGTxxx.BBS, it should be opened in a
DENYNONE and READONLY mode. Any other method of opening
will stop other tasks accessing the message base. When
writing the message (the time when it is physically being
written), the file should be opened in a DENYWRITE and
WRITEONLY mode. This will stop any other tasks writing the
message at the same time. The text for a new message should
be written before the header. The header should be written
while the MSGTxxx.BBS is in a DENYWRITE and WRITEONLY mode.
All reply chains, MSGFAST, MSGCOUNT, MSGEXPRT should also be
updated while the MSGTxxx.BBS is locked for writing. The
actual message text follows a specific format. Each line of
text MUST be terminated by either an 0x08D or 0x0D. The
0x08D indicates a soft carriage return, and is a movable
boundary, whereas the 0x0D indicates a hard carriage return,
and is not moveable. The message text should end with a
null terminator (0x00), which aids reading infinately long
messages.
3.4 MSGFAST.BBS
This is an index for mail checks. Simply scanning the
MSGHxxx.BBS for who the message was to, took to long, so
this index was made. It is possible for you to scan the
MSGHxxx.BBS for mail checks, although unwise. When writing
messages, this file MUST be updated, otherwise programs that
use this, will not see new messages for mail checks. The
whoto field in the MSGFAST record, is a standard 32 Bit CRC
of the users name. The CRC generated, should be done on an
uppercase USERNAME, and should not include the PASCAL length
byte, or the C null terminator. The initial starting
position for the CRC is the usual 0x0FFFFFFFF ($FFFFFFFF).
The msgboard variable holds the number of the message board
where this message exists. The msgnumber variable holds the
record number of the message in the message board. It
should be noted that Ezycom optimizes this file, so that
received messages are not placed in this file. This should
not concern the developer though.
3.5 MSGCOUNT.BBS
Since, Ezycom now uses 1024 message areas, it was
neccessary that a file be used to hold the number of
messages in each area. This file should ALWAYS be opened in
a DENYNONE and READ/WRITE/READWRITE mode. The only program
to completly lock this file is MSGCOMP, as it is packing the
message base, so simultaneous access is not possible. It
should be noted that you can also obtain the number of
messages in an area by obtaining the filesize of the
MSGHxxx.BBS and dividing it by the size of the MSGHxxx.BBS
structure.
3.6 MSGEXPRT.BBS
This file simply holds a byte telling the
echomail/netmail scanner, which message areas require
scanning. A value of 0 indicates that no scan is required,
whereas a value of 1 indicates a scan is required. In
Pascal a value of 0 is defined as false, and a value of 1 is
defined as true. This file should be updated, whenever a
message is written to a message area that is an
echomail/netmail area.
3.7 MSGREPLY.BBS
This file is similar to the previous, but holds which
message areas require reply chains. If, your program
automatically does reply chaining (EZYUNIT.PAS does
automatic reply chaining), then you do not have to set this
bit. Echomail tossers (EZYMAIL) and Offline Readers usually
set this, and reply chain linking is not possible. The
message compacter (MSGCOMP) will pick up that the area needs
reply chaining, and hence chain messages with the same
subject together.
3.8 Pascal Strings
For those coding in C, the pascal string varies
slighty. It does not include a null terminator, and has a
length byte (length of string) at position [0] of the
string, indicating its length.
4.0 Conclusion
The Ezycom message base is fairly simple in structure,
but offers a high performance when in use. This gives
multiple line BBSs significant speed enhancement over other
message base structures. If, you have any queries,
suggestions, etc please do not hesitate in contacting me.
Peter Davies
PO Box 43
Bentleigh VIC 3204
Australia
Fidonet 3:636/213
Internet daviesex@brt.deakin.edu.au
BBS +61-3-578-0968 V22bis/V32 MNP4